package net.hn.hnms.biz.plan.service.impl;

import net.hn.hnms.biz.plan.domain.ExecutionPeel;
import net.hn.hnms.biz.plan.mapper.ExecutionPeelMapper;
import net.hn.hnms.biz.plan.service.ExecutionPeelService;
import net.hn.hnms.biz.plan.vo.ExecutionPeelVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

import static net.hn.hnms.sys.common.core.enums.CoalInfo.getCompanyCodeByMineCode;

@Service
public class ExecutionPeelServiceImpl  extends BaseService<ExecutionPeel, ExecutionPeelVO> implements ExecutionPeelService {



    @Autowired
    private ExecutionPeelMapper executionPeelMapper;


    @Override
    public int insert(int i, Date date,String mineCode) {
        ExecutionPeel executionPeel = new ExecutionPeel();
        executionPeel.setExecutionDate(date);
        executionPeel.setMineCode(mineCode);
        executionPeel.setCompanyCode(getCompanyCodeByMineCode(mineCode));
        executionPeelMapper.insert(executionPeel);

        return 0;
    }
}
